package com.zrl.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author: zrl
 * @date: 2022/8/17 16:49
 * @description:
 */
@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${wechat.WxopenId}")
    private String WxopenId;

    @Value("${wechat.WxAppid}")
    private String WxAppid;

    @Value("${wechat.WxAppsecret}")
    private String WxAppsecret;

    @Value("${wechat.templateId}")
    private String templateId;

    @Value("${weather.weatherKey}")
    private String weatherKey;

    @Value("${date.loveDay}")
    private String loveDay;

    @Value("${date.birthDay}")
    private String birthDay;



    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String TEMPLATE_ID;
    public static String OPEN_ID;
    public static String WEATHER_KEY;
    public static String LOVE_DAY;
    public static String BIRTHDAY;



    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESS_KEY_ID = WxAppid;
        ACCESS_KEY_SECRET = WxAppsecret;
        TEMPLATE_ID = templateId;
        OPEN_ID = WxopenId;
        WEATHER_KEY = weatherKey;
        LOVE_DAY = loveDay;
        BIRTHDAY = birthDay;
    }
}
